﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

namespace XmlDSigEx
{
    class NamespaceOrderComparer:IComparer<XmlAttribute>
    {
        #region IComparer<XmlAttribute> Members

        public int Compare(XmlAttribute x, XmlAttribute y)
        {
            if (x.Name != y.Name)
            {
                if (x.Name == "xmlns")
                    return -1;
                if (y.Name == "xmlns")
                    return 1;
            }
            return string.Compare(x.LocalName, y.LocalName);
        }

        #endregion
    }
}
